package subject;

import java.sql.*;

public class Totalstuno2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Connection con = DBUtil.getConnection();
		Statement st = null;
		ResultSet rs = null;
		String sql = "select count(stuno) as t from student";
		try {
			st = con.createStatement();
			rs = st.executeQuery(sql);
			if (rs.next()) {
				System.out.println(rs.getInt("t"));
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			DBUtil.close(con, st, rs);
		}

	}

}
